package com.lpf.service;

import java.lang.reflect.Proxy;

/**
 * 获取SqlSession对象
 */
@SuppressWarnings("ALL")
public class SqlSession {

    // 获取getMapper
    public static <T> T getMapper(Class<T> clas) throws IllegalArgumentException {
        return (T) Proxy.newProxyInstance(clas.getClassLoader(), new Class[]{clas}, new MyInvocationHandlerMybatis(clas));
    }
}